import request from "@/config/index.js"
import { useRouter } from "vue-router";
const router = useRouter();

/**
 * login
 * @param data
 */
// 登录API
export const login = (data) => {
  return request.post('/api/StuAccount/login', data);
};

// 注册API
export const register = (data) => {
  return request.post('/api/StuAccount/register', data);
};

// 重置密码API
export const resetPassword = (data) => {
  return request.post('api/StuAccount/reset-password', data);
};


// 添加获取用户菜单API
export const getUserMenu = () => {
  return router.options.routes.find((i) => i.path === "/").children;
};


// 获取学生照片API
export const getStuPhoto = (type) => {
  return request.get(`/api/StuRecordConttroller/Photo?type=${type}`);
}


